<!---
	Copyright 2010 Edward Trudeau, Jeremy Battle
    This software is freely available under the MIT License: http://www.opensource.org/licenses/mit-license.php
    http://ayc.googlecode.com
    
--->

component persistent="true" table="agencies" extends="wtf.aycBase" schema="dbo" output="false"
{
	/* properties */	
	property name="agencyid" column="id" type="numeric" ormtype="int" fieldtype="id" generator="identity"; 
	property name="name" column="name" type="string" ormtype="string"; 
	property name="address1" column="address1" type="string" ormtype="string"; 
	property name="address2" column="address2" type="string" ormtype="string"; 
	property name="city" column="city" type="string" ormtype="string"; 
	property name="state" column="state" type="string" ormtype="string"; 
	property name="zipCode" column="zipCode" type="string" ormtype="string"; 
	property name="location" column="location" type="string" ormtype="string"; 
	property name="phone" column="phone" type="string" ormtype="string"; 
	property name="fax" column="fax" type="string" ormtype="string"; 
	property name="website" column="website" type="string" ormtype="string"; 
	property name="acceptUGJunior" column="acceptUGJunior" type="numeric" ormtype="int"; 
	property name="acceptUGSenior" column="acceptUGSenior" type="numeric" ormtype="int"; 
	property name="acceptFirstYear" column="acceptFirstYear" type="numeric" ormtype="int"; 
	property name="acceptSecondYear" column="acceptSecondYear" type="numeric" ormtype="int"; 
	property name="totalStudents" column="totalStudents" type="string" ormtype="string"; 
	property name="agencyPractice" column="agencyPractice" type="string" ormtype="string"; 
	property name="servicesProvided" column="servicesProvided" type="string" ormtype="string"; 
	property name="theoryBase" column="theoryBase" type="string" ormtype="string"; 
	property name="macroArea" column="macroArea" type="string" ormtype="string"; 
	property name="clinicalArea" column="clinicalArea" type="string" ormtype="string"; 
	property name="other" column="other" type="string" ormtype="string"; 
	property name="stipend" column="stipend" type="string" ormtype="string"; 
	property name="forProfit" column="forProfit" type="numeric" ormtype="boolean"; 
	property name="clinical" column="clinical" type="numeric" ormtype="boolean"; 
	property name="foundation" column="foundation" type="numeric" ormtype="boolean"; 
	property name="macro" column="macro" type="numeric" ormtype="boolean"; 
	property name="combined" column="combined" type="numeric" ormtype="boolean"; 
	property name="health" column="health" type="numeric" ormtype="boolean"; 
	property name="metro" column="metro" type="numeric" ormtype="boolean"; 
	property name="carLicense" column="carLicense" type="numeric" ormtype="boolean"; 
	property name="foriegnLanguage" column="foriegnLanguage" type="numeric" ormtype="boolean"; 
	property name="flexTime" column="flexTime" type="numeric" ormtype="boolean"; 
	property name="handicapAccessible" column="handicapAccessible" type="numeric" ormtype="boolean"; 
	property name="faithBased" column="faithBased" type="numeric" ormtype="boolean"; 
	property name="affiliationAgreement" column="affiliationAgreement" type="numeric" ormtype="boolean"; 
	property name="fwsAgreement" column="fwsAgreement" type="numeric" ormtype="boolean"; 
	property name="agencyProfile" column="agencyProfile" type="numeric" ormtype="boolean"; 
	property name="multipleSites" column="multipleSites" type="numeric" ormtype="boolean"; 
	property name="dateNinetyNine" column="dateNinetyNine" type="date" ormtype="timestamp"; 
	property name="datePhoneInformationReceived" column="datePhoneInformationReceived" type="date" ormtype="timestamp"; 
	property name="dateOfAffiliation" column="dateOfAffiliation" type="date" ormtype="timestamp"; 
	property name="dateOfVisit" column="dateOfVisit" type="date" ormtype="timestamp"; 
	property name="backgroundDrugScreening" column="backgroundDrugScreening" type="numeric" ormtype="boolean"; 
	property name="backgroundChildAbuse" column="backgroundChildAbuse" type="numeric" ormtype="boolean"; 
	property name="backgroundImmunizationVerification" column="backgroundImmunizationVerification" type="numeric" ormtype="boolean"; 
	property name="backgroundLiabilityVerification" column="backgroundLiabilityVerification" type="numeric" ormtype="boolean"; 
	property name="backgroundSpecialApplication" column="backgroundSpecialApplication" type="numeric" ormtype="boolean"; 
	property name="backgroundReferenceLetters" column="backgroundReferenceLetters" type="numeric" ormtype="boolean"; 
	property name="backgroundFingerprinting" column="backgroundFingerprinting" type="numeric" ormtype="boolean"; 
	property name="backgroundPoliceClearance" column="backgroundPoliceClearance" type="numeric" ormtype="boolean"; 
	property name="backgroundTBScreen" column="backgroundTBScreen" type="numeric" ormtype="boolean"; 
	property name="backgroundOther" column="backgroundOther" type="string" ormtype="string"; 
	property name="backgroundRequiredDays" column="backgroundRequiredDays" type="string" ormtype="string"; 
	property name="ageGroupAdults" column="ageGroupAdults" type="numeric" ormtype="boolean"; 
	property name="ageGroupOlderAdults" column="ageGroupOlderAdults" type="numeric" ormtype="boolean"; 
	property name="ageGroupAdolescents" column="ageGroupAdolescents" type="numeric" ormtype="boolean"; 
	property name="ageGroupFamilies" column="ageGroupFamilies" type="numeric" ormtype="boolean"; 
	property name="ageGroupChildren0to5" column="ageGroupChildren0to5" type="numeric" ormtype="boolean"; 
	property name="ageGroupChildren6to12" column="ageGroupChildren6to12" type="numeric" ormtype="boolean"; 
	property name="comments" column="comments" type="string" ormtype="string"; 
	property name="needsLongForm" column="needsLongForm" type="numeric" ormtype="boolean"; 
	property name="currentlyActive" column="currentlyActive" type="numeric" ormtype="boolean"; 
	property name="doNotUse" column="doNotUse" type="numeric" ormtype="boolean"; 
	property name="agencyFlag" column="agencyFlag" type="numeric" ormtype="boolean"; 
	property name="typeOfSetting" column="typeOfSetting" type="string" ormtype="string"; 
	property name="privateComments" column="privateComments" type="string" ormtype="string"; 
	property name="leAdministration" column="leAdministration" type="numeric" ormtype="byte"; 
	property name="leAdvocacy" column="leAdvocacy" type="numeric" ormtype="byte"; 
	property name="leCaseManagement" column="leCaseManagement" type="numeric" ormtype="byte"; 
	property name="leClinicalCaseManagement" column="leClinicalCaseManagement" type="numeric" ormtype="byte"; 
	property name="leCommOrganization" column="leCommOrganization" type="numeric" ormtype="byte"; 
	property name="leCrisisIntervention" column="leCrisisIntervention" type="numeric" ormtype="byte"; 
	property name="leDischargePlanning" column="leDischargePlanning" type="numeric" ormtype="byte"; 
	property name="leFamilyTreatment" column="leFamilyTreatment" type="numeric" ormtype="byte"; 
	property name="leGroupTreatment" column="leGroupTreatment" type="numeric" ormtype="byte"; 
	property name="leIndWithAdult" column="leIndWithAdult" type="numeric" ormtype="byte"; 
	property name="leIndWithChildren" column="leIndWithChildren" type="numeric" ormtype="byte"; 
	property name="leIndWithAdolescents" column="leIndWithAdolescents" type="numeric" ormtype="byte"; 
	property name="lePolicyAnalysis" column="lePolicyAnalysis" type="numeric" ormtype="byte"; 
	property name="leProgramPlanning" column="leProgramPlanning" type="numeric" ormtype="byte"; 
	property name="leProgramManagement" column="leProgramManagement" type="numeric" ormtype="byte"; 
	property name="leResearch" column="leResearch" type="numeric" ormtype="byte"; 
	property name="leOther1" column="leOther1" type="string" ormtype="string"; 
	property name="leOther2" column="leOther2" type="string" ormtype="string"; 
	property name="tbCogBehavioral" column="tbCogBehavioral" type="numeric" ormtype="boolean"; 
	property name="tbCommTheory" column="tbCommTheory" type="numeric" ormtype="boolean"; 
	property name="tbCommDevelopment" column="tbCommDevelopment" type="numeric" ormtype="boolean"; 
	property name="tbContingency" column="tbContingency" type="numeric" ormtype="boolean"; 
	property name="tbCrisis" column="tbCrisis" type="numeric" ormtype="boolean"; 
	property name="tbEcological" column="tbEcological" type="numeric" ormtype="boolean"; 
	property name="tbEmpowerment" column="tbEmpowerment" type="numeric" ormtype="boolean"; 
	property name="tbExchange" column="tbExchange" type="numeric" ormtype="boolean"; 
	property name="tbFamilyTherapy" column="tbFamilyTherapy" type="numeric" ormtype="boolean"; 
	property name="tbFeminist" column="tbFeminist" type="numeric" ormtype="boolean"; 
	property name="tbPowerDependence" column="tbPowerDependence" type="numeric" ormtype="boolean"; 
	property name="tbPsychodynamic" column="tbPsychodynamic" type="numeric" ormtype="boolean"; 
	property name="tbPsychosocial" column="tbPsychosocial" type="numeric" ormtype="boolean"; 
	property name="tbSolution" column="tbSolution" type="numeric" ormtype="boolean"; 
	property name="tbSystems" column="tbSystems" type="numeric" ormtype="boolean"; 
	property name="tbTranspersonal" column="tbTranspersonal" type="numeric" ormtype="boolean"; 
	property name="lobbying" column="lobbying" type="numeric" ormtype="boolean"; 
	property name="nonProfit" column="nonProfit" type="numeric" ormtype="boolean"; 
	property name="agencyPublic" column="agencyPublic" type="numeric" ormtype="boolean"; 
	property name="agencyPrivate" column="agencyPrivate" type="numeric" ormtype="boolean"; 
	property name="federal" column="federal" type="numeric" ormtype="boolean"; 
	property name="stateCounty" column="stateCounty" type="numeric" ormtype="boolean"; 
	property name="communityBased" column="communityBased" type="numeric" ormtype="boolean"; 
	property name="undergraduateJunior" column="undergraduateJunior" type="numeric" ormtype="boolean"; 
	property name="ataother" column="ataother" type="string" ormtype="string"; 
	property name="adultsRank" column="adultsRank" type="numeric" ormtype="int"; 
	property name="olderAdultsRank" column="olderAdultsRank" type="numeric" ormtype="int"; 
	property name="adolescentsRank" column="adolescentsRank" type="numeric" ormtype="int"; 
	property name="familiesRank" column="familiesRank" type="numeric" ormtype="int"; 
	property name="children0to5Rank" column="children0to5Rank" type="numeric" ormtype="int"; 
	property name="children6to12Rank" column="children6to12Rank" type="numeric" ormtype="int"; 
	property name="multiple" column="multiple" type="string" ormtype="string"; 
	property name="isPrivate" column="isPrivate" type="numeric" ormtype="boolean"; 
	property name="isPublic" column="isPublic" type="numeric" ormtype="boolean"; 
	property name="completedDate" column="completedDate" type="date" ormtype="timestamp"; 
	property name="completedName" column="completedName" type="string" ormtype="string"; 
	property name="completedEmail" column="completedEmail" type="string" ormtype="string"; 
	property name="undergraduateSenior" column="undergraduateSenior" type="numeric" ormtype="boolean"; 
	property name="transport" column="transport" type="numeric" ormtype="boolean"; 
	property name="backgroundMedicalExam" column="backgroundMedicalExam" type="numeric" ormtype="boolean"; 
	property name="tHomeVisits" column="tHomeVisits" type="numeric" ormtype="boolean"; 
	property name="tDriversLicense" column="tDriversLicense" type="numeric" ormtype="boolean"; 
	property name="tAutomobile" column="tAutomobile" type="numeric" ormtype="boolean"; 
	property name="tAgencyVehicle" column="tAgencyVehicle" type="numeric" ormtype="boolean"; 
	property name="tOwnVehicle" column="tOwnVehicle" type="numeric" ormtype="boolean"; 
	property name="tCovered" column="tCovered" type="numeric" ormtype="boolean"; 
	property name="tOther" column="tOther" type="string" ormtype="string"; 
	property name="mpPolicyAnalysis" column="mpPolicyAnalysis" type="numeric" ormtype="byte"; 
	property name="mpAdvocacy" column="mpAdvocacy" type="numeric" ormtype="byte"; 
	property name="mpCommOrganization" column="mpCommOrganization" type="numeric" ormtype="byte"; 
	property name="mpManagement" column="mpManagement" type="numeric" ormtype="byte"; 
	property name="mpAdministration" column="mpAdministration" type="numeric" ormtype="byte"; 
	property name="mpPlanning" column="mpPlanning" type="numeric" ormtype="byte"; 
	property name="mpEvalResearch" column="mpEvalResearch" type="numeric" ormtype="byte"; 
	property name="comments2" column="comments2" type="string" ormtype="string"; 
	property name="notSureYet" column="notSureYet" type="numeric" ormtype="boolean"; 
	property name="flexHours" column="flexHours" type="string" ormtype="string"; 
	property name="leIndWithAdultAdd" column="leIndWithAdultAdd" type="string" ormtype="string"; 
	property name="leIndWithChildrenAdd" column="leIndWithChildrenAdd" type="string" ormtype="string"; 
	property name="leIndWithAdolescentsAdd" column="leIndWithAdolescentsAdd" type="string" ormtype="string"; 
	property name="foreignLanguagePreferred" column="foreignLanguagePreferred" type="numeric" ormtype="boolean";
	
	property name="area" type="array" singularname="area" 
			 fieldtype="many-to-many" cfc="area" linktable="agencyAreas"
			 fkcolumn="agencyid" inversejoincolumn="areaid";
	
	property name="agencycontact" type="array" fieldtype="one-to-many" inverse="true" cfc="agencycontact" fkcolumn="agencyid";
		 
	
			 
	public string function getDisplayColumns(){
		/*these are case sensitive*/
		var displayColumns = "name,address1,address2,city,state,zipCode,phone,fax";
		return displayColumns;
	}
	
	public string function hasMany(){
		return "area|Areas,agencycontact|Agency Contacts";
	}
} 


